Hệ thống quản lý thanh toán POS nhà hàng

1 Imports System.Data.OleDb
2
3
4 Public Class frmBillingRecord
5     Private Sub GetData()
6         Try
7             con = New OleDbConnection(cs)
8             con.Open()
9             
'cmd = New OleDbCommand("SELECT RTRIM(UserID),[Date],RTRIM(Operation) from Logs order by Date", con)
10             cmd = New OleDbCommand(
"SELECT RTRIM(DishName), RTRIM(Category),RTRIM(Kitchen),InventoryType, Rate,Discount from Dish order by DishName", con)
11             rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
12             dgvbillrecord.Rows.Clear()
13             While (rdr.Read() = True)
14                 dgvbillrecord.Rows.Add(rdr(
0), rdr(1), rdr(2), rdr(3), rdr(4), rdr(5))
15             End While
16             con.Close()
17         Catch ex As Exception
18             MessageBox.Show(ex.Message,
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
19         End Try
20     End Sub
21
22     Private Sub dgvbillrecord_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvbillrecord.CellDoubleClick
23         
24     End Sub
25
26    
27
28     Private Sub dgvbillrecord_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvbillrecord.DoubleClick
29         
'this.customersDataGridView.Columns[0].Visible = false;
30
31         Me.dgvbillrecord.Columns(
"SelectBill").Visible = True
32     End Sub
33
34
35
36     Private Sub dgw_RowPostPaint(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowPostPaintEventArgs) Handles dgvbillrecord.RowPostPaint
37         Dim strRowNumber As String = (e.RowIndex +
1).ToString()
38         Dim size As SizeF = e.Graphics.MeasureString(strRowNumber, Me.Font)
39         If dgvbillrecord.RowHeadersWidth < Convert.ToInt32((size.Width +
20)) Then
40             dgvbillrecord.RowHeadersWidth = Convert.ToInt32((size.Width +
20))
41         End If
42         Dim b As Brush = SystemBrushes.ControlText
43         e.Graphics.DrawString(strRowNumber, Me.Font, b, e.RowBounds.Location.X +
15, e.RowBounds.Location.Y + ((e.RowBounds.Height - size.Height) / 2))
44     End Sub
45
46
47     Private Sub frmBillingRecord_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
48         GetData()
49     End Sub
50
51 End Class


Gõ tìm kiếm nhanh...